import type { Visitor } from '@/types/visitor'
import { http } from '@/utils/http'

/**
 * 获取自己的出游人列表
 */
export const getVisitorListApi = () => {
  return http<Visitor[]>({
    method: 'GET',
    url: '/visitor/index',
  })
}

/**
 * 获取自己的出游人明细
 */
export const getVisitorDetailApi = (id: number) => {
  return http<Visitor>({
    method: 'GET',
    url: '/visitor/detail',
    data: { id },
  })
}

/**
 * 保存出游人
 */
export const postVisitorSaveApi = (visitor: Visitor) => {
  return http<Visitor>({
    method: 'POST',
    url: '/visitor/save',
    data: visitor,
  })
}
